package com.zhiche.lisa.bms.service.psup.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.google.common.collect.Lists;
import com.zhiche.lisa.bms.dao.mapper.psup.PsupBaseDataMapper;
import com.zhiche.lisa.bms.dao.model.psup.PsupBaseData;
import com.zhiche.lisa.bms.pojo.vo.psup.PsupSdFleetVO;
import com.zhiche.lisa.bms.service.psup.PsupBaseDataService;
import com.zhiche.lisa.bms.service.psup.PsupSdFleetService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.method.P;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 人送车队数据 服务实现类
 * </p>
 *
 * @author linbao
 * @since 2019-06-18
 */
@Service
@Slf4j
public class PsupSdFleetServiceImpl implements PsupSdFleetService {

    @Autowired
    private PsupBaseDataMapper psupBaseDataMapper;

    /**
     * 获取所有的人送车队数据
     *
     * @return
     */
    @Override
    public List<PsupSdFleetVO> getSdFleetList() {
        List<PsupBaseData> fleetList = psupBaseDataMapper.getFleetList();
        if (CollectionUtils.isNotEmpty(fleetList)) {
            List<PsupSdFleetVO> voList = Lists.newArrayList();
            fleetList.forEach(fleetObj -> {
                PsupSdFleetVO vo = new PsupSdFleetVO();
                vo.setFleetId(fleetObj.getFleetId());
                vo.setFleetName(fleetObj.getFleetName());
                voList.add(vo);
            });
            return voList;
        }
        return null;
    }
}
